<template>
  <div class="person_div">
    <el-container class="person_div">
      <el-aside width="15%">
        <el-button type="primary" class="btn_new" @click="toGuide"> 新 建 <i class="el-icon-document-add"></i></el-button>
        <br>
        <br>
        <el-button type="success" class="btn_new" @click="updateCard(0)" round> 我的问卷 <i class="el-icon-document"></i>
        </el-button>
        <br>
        <br>
        <el-button type="info" class="btn_new" @click="updateCard(1)" round> 回收站 <i class="el-icon-delete"></i>
        </el-button>
      </el-aside>
      <el-main>
        <QCard ref="card"></QCard>
      </el-main>
    </el-container>
  </div>
</template>
<script>
import QCard from '../components/question_card.vue'

export default {
  name: "person",
  components: {
    "QCard": QCard,
  },
  data() {
    return {
      personData: {
        questions: [{}]
      },
    };
  },
  methods: {
    toGuide() {
      this.$router.push("/survey/addnew")
    },
    updateCard(state) {
      console.log("update")
      this.$refs.card.queryData(state)
    }
  },
}
</script>

<style scoped>


.person_div {
  height: 100%;
  width: 100%;
}

.btn_new {
  position: relative;
  top: 30px;
  width: 80%;
}


.el-main {
  background: #F2F6FC;
}

.el-aside {
  position: relative;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  text-align: center;
}
</style>